#include "Separator.h"

///<************************************************************************************************************>
///<************************************* region CONSTANTS DEFINITION ******************************************>
///<************************************************************************************************************>

const QString CIGui::Separator::STYLE_SHEET = QString ("border: 1px solid gray;"
                                                    "border-radius: 3px;" +                                
                                                    GENERAL_BACKGROUND
                                                    );
/***************************************************************************************************************
************************************** endregion CONSTANTS DEFINITION ******************************************
****************************************************************************************************************/






/// <summary>
/// Constructor
/// </summary>
/// <param name="parent"> The widget parent </param>
CIGui::Separator::Separator (QWidget* parent, int type) : QFrame (parent) {
    setSizePolicy (QSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding));
    setStyleSheet (STYLE_SHEET);

    //Setting the separator type (can be vertical or horizontal)
    this->type = type;

    //Setting mouse over cursor
    switch (type) {
        case HORIZONTAL:
            setCursor (Qt::SizeVerCursor);
            setMinimumSize (0, 7);
            setMaximumSize (10000, 7);
            break;

        default: 
            setCursor (Qt::SizeHorCursor);
            setMinimumSize (7, 0);
            setMaximumSize (7, 10000);
            break;
    }

}

/// <summary>
/// Destructor
/// </summary>
CIGui::Separator::~Separator() {
}
